import EventName from "./EventName";
import UserData from "./UserData";


const { ccclass, property } = cc._decorator;

@ccclass
export default class InfoPanel extends cc.Component {

    @property(cc.Node)
    root: cc.Node = null;

    protected onLoad(): void {

        cc.director.getScene().on(EventName.UPDATE_GAME_CONTENT, this.updateUI, this);
        this.updateUI();
    }


    updateUI() {
        if (UserData.getInstance().birthData) {
            this.root.opacity = 255;
        } else {
            this.root.opacity = 0;
        }
    }


}
